<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta name="decorator" content="sysDefault"/>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
				  <div class="panel-heading">
				    <h3 class="panel-title">
				    	系统权限
						<a class="btn btn-success btn-sm pull-right" style="color: #fff;" href="${contextPath}/sys/auth/initPermissionData">初始化系统权限</a>
				    </h3>
				  </div>
				  <div class="panel-content" style="padding: 10px;">
					 <div class="panel-group" id="accordionP">
					  	<c:forEach var="subsystem" items="${subsysList}" varStatus="var">
						  <div class="panel panel-default">
						    <div class="panel-heading">
						      <h4 class="panel-title">
						        <a data-toggle="collapse" data-toggle="collapse" data-parent="#accordionP" href="#collapse${var.index}">
						          <span class="glyphicon glyphicon-flag"></span>
						          ${subsystem.name}
						        </a>
						      </h4>
						    </div>
						    <div id="collapse${var.index}" class="panel-collapse collapse in">
						      <div class="panel-body">
									 <div class="panel-group" id="accordion${var.index}">
									  	<c:forEach var="module" items="${subsystem.modules}" varStatus="var2">
									  		<c:if test="${module.parentId == null }">
											  <div class="panel panel-default">
											    <div class="panel-heading">
											      <h4 class="panel-title">
											        <a data-toggle="collapse" data-toggle="collapse" data-parent="#accordion${var.index}" href="#collapse${var.index}-${var2.index}">
											          <span class="glyphicon glyphicon-stop"></span>
											          ${module.moduleName}
											        </a>
											      </h4>
											    </div>
											    <div id="collapse${var.index}-${var2.index}" class="panel-collapse collapse">
											      <div class="panel-body">
														 <div class="panel-group" id="accordion${var.index}-${var2.index}">
											        		<c:forEach var="module2" items="${subsystem.modules}" varStatus="var3">
														  		<c:if test="${module2.parentId == module.id}">
																  <div class="panel panel-default">
																    <div class="panel-heading">
																      <h4 class="panel-title">
																        <a data-toggle="collapse" data-toggle="collapse" data-parent="#accordion${var.index}-${var2.index}" href="#collapse${var.index}-${var2.index}-${var3.index}">
																          <span class="glyphicon glyphicon-stop"></span>
																          ${module2.moduleName}
																        </a>
																      </h4>
																    </div>
																    <div id="collapse${var.index}-${var2.index}-${var3.index}" class="panel-collapse collapse">
																      <div class="panel-body">
																		 <div class="panel-group" id="accordion${var.index}-${var2.index}-${var3.index}">
															        		<c:forEach var="module3" items="${subsystem.modules}" varStatus="var4">
																		  		<c:if test="${module3.parentId == module2.id}">
																				  <div class="panel panel-default">
																				    <div class="panel-heading">
																				      <h4 class="panel-title">
																				        <a data-toggle="collapse" data-toggle="collapse" data-parent="#accordion${var.index}-${var2.index}-${var3.index}" href="#collapse${var.index}-${var2.index}-${var3.index}-${var4.index}">
																				          <span class="glyphicon glyphicon-stop"></span>
																				          ${module3.moduleName}
																				        </a>
																				      </h4>
																				    </div>
																				    <div id="collapse${var.index}-${var2.index}-${var3.index}-${var4.index}" class="panel-collapse collapse">
																				      <div class="panel-body">
																				      	  <div class="panel-group" id="accordion${var.index}-${var2.index}-${var3.index}-${var4.index}">
																			        		<c:forEach var="module4" items="${subsystem.modules}" varStatus="var5">
																						  		<c:if test="${module4.parentId == module3.id}">
																								  <div class="panel panel-default">
																								    <div class="panel-heading">
																								      <h4 class="panel-title">
																								        <a data-toggle="collapse" data-toggle="collapse" data-parent="#accordion${var.index}-${var2.index}-${var3.index}-${var4.index}" href="#collapse${var.index}-${var2.index}-${var3.index}-${var4.index}-${var5.index}">
																								          <span class="glyphicon glyphicon-stop"></span>
																								          ${module4.moduleName}
																								        </a>
																								      </h4>
																								    </div>
																								    <div id="collapse${var.index}-${var2.index}-${var3.index}-${var4.index}-${var5.index}" class="panel-collapse collapse">
																								      <div class="panel-body">
																								       	  <section class="maoye-checkbox">
																									       	  <c:forEach var="permission4" items="${module4.permissions }">
																									       	  	<label style="width:20%;" title="${permission4.key }"><input type="checkbox" name="permIds" value="${permission4.id }"> <c:out value="${permission4.name }"></c:out></label> &nbsp;
																									       	  </c:forEach>
																							              </section>
																								      </div>
																								    </div>
																								  </div>
																						  		</c:if>
																							</c:forEach>
																				      	  </div>
																				       	  <section class="maoye-checkbox">
																					       	  <c:forEach var="permission3" items="${module3.permissions }">
																					       	  	<label style="width:20%;" title="${permission3.key }"><input type="checkbox" name="permIds" value="${permission3.id }"> <c:out value="${permission3.name }"></c:out></label> &nbsp;
																					       	  </c:forEach>
																			              </section>
																				      </div>
																				    </div>
																				  </div>
																		  		</c:if>
																			</c:forEach>
																      	  </div>
																       	  <section class="maoye-checkbox">
																	       	  <c:forEach var="permission2" items="${module2.permissions }">
																	       	  	<label style="width:20%;" title="${permission2.key }"><input type="checkbox" name="permIds" value="${permission2.id }"> <c:out value="${permission2.name }"></c:out></label> &nbsp;
																	       	  </c:forEach>
															              </section>
																      </div>
																    </div>
																  </div>
														  		</c:if>
															</c:forEach>
												      	  </div>
										             <section class="maoye-checkbox">
											            <c:forEach var="permission" items="${module.permissions }">
											       	  		<label style="width:20%;" title="${permission.key }"><input type="checkbox" name="permIds" value="${permission.id }"> <c:out value="${permission.name }"></c:out></label> &nbsp;
											       	  	</c:forEach>
										             </section>
											      </div>
											    </div>
											  </div>
									  		</c:if>
										</c:forEach>
									  </div>
						      </div>
						    </div>
						  </div>
						</c:forEach>
					  </div>
				   </div>
				  </div>
				</div>			
			</div>
		</div>
	</div>
</body>
</html>